<template>
  <common-page-template
    v-bind="pageData"
    :columns="columns"
    @page-change="pageChange"
  />
</template>

<script setup>
import { onMounted, h } from "vue";
import usePage from "@/hooks/usePage";
import { formateTime } from '@/utils/time'
import { PageLogs } from "@/apis/log";
const { pageData, handleQuery, pageChange } = usePage(
  PageLogs,
  "records"
);
const columns = [
  {
    prop: "id",
    label: "编号",
    width: 70,
    align: "center",
  },
  {
    prop: "description",
    label: "行为名称",
    minWidth: 120,
    align: "center",
  },
  {
    prop: "username",
    label: "操作人",
    width: 120,
    align: "center",
  },
  {
    prop: "requestIp",
    label: "操作IP",
    minWidth: 120,
    align: "center",
  },
  {
    label: "操作时间",
    width: 180,
    align: "center",
    render: (row) => {
        return h('span', formateTime(row.createdTime, 'YYYY-MM-DD HH:mm:ss'))
    }
  },
];
onMounted(() => {
  handleQuery();
});
</script>

